// shared/dynamic-elements/html-viewer/html-viewer.ts
var WxParse = require('../../../wxParse/wxParse.js');

Component({
  lifetimes: {
    created() {

    },
    ready() {
      // let that = this;
      // debugger
      // let text = this.data.item.text.replace(/<style.*style>/g, 'aaa')
      // debugger
      // WxParse.wxParse('article', 'html', text, that, 5);
    },
  },
  /**
   * 组件的属性列表
   */
  properties: {
    item: {
      type: Object,
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    htmlSnip: ''
  },

  observers: {
    'item': function () {
      debugger
      let that = this;
      let text = this.properties.item.text?.replace(/[\r\n]/g, "");
      text = text?.replace(/<style.*style>/g, '');
      text = text?.replace(/<!DOCTYPE.*strict.dtd">/g, '');
      WxParse.wxParse('article', 'html', text, that, 5);
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {

  },
})
